//
//  CGPath.swift
//  Documentation
//
//  Created by Toj on 3/29/23.
//

import Foundation

public class CGPath { }

extension CGPath {

    public func copy(dashingWithPhase phase: CGFloat, lengths: [CGFloat], transform: CGAffineTransform = .identity) -> CGPath

    public func copy(strokingWithWidth lineWidth: CGFloat, lineCap: CGLineCap, lineJoin: CGLineJoin, miterLimit: CGFloat, transform: CGAffineTransform = .identity) -> CGPath

    public func contains(_ point: CGPoint, using rule: CGPathFillRule = .winding, transform: CGAffineTransform = .identity) -> Bool
}

extension CGPath {

    
    /* Return the CFTypeID for CGPathRefs. */
    
    @available(iOS 2.0, *)
    public class var typeID: CFTypeID { get }

    
    /* Create a mutable path. */
    
    /* Create a copy of `path'. */
    
    @available(iOS 2.0, *)
    public func copy() -> CGPath?

    
    /* Create a copy of `path' transformed by `transform'. */
    
    @available(iOS 5.0, *)
    public func copy(using transform: UnsafePointer<CGAffineTransform>?) -> CGPath?

    
    /* Create a mutable copy of `path'. */
    
    @available(iOS 2.0, *)
    public func mutableCopy() -> CGMutablePath?

    
    /* Create a mutable copy of `path' transformed by `transform'. */
    
    @available(iOS 5.0, *)
    public func mutableCopy(using transform: UnsafePointer<CGAffineTransform>?) -> CGMutablePath?

    
    /* Return a path representing a rectangle bounded by `rect'. The rectangle
       forms a complete subpath of the path --- that is, it begins with a "move
       to" and ends with a "close subpath" --- oriented in the clockwise
       direction. If `transform' is non-NULL, then the lines representing the
       rectangle will be transformed by `transform' before they are added to the
       path. */
    
    @available(iOS 4.0, *)
    public /*not inherited*/ init(rect: CGRect, transform: UnsafePointer<CGAffineTransform>?)

    
    /* Return a path representing an ellipse bounded by `rect'. The ellipse is
       approximated by a sequence of Bézier curves. The center of the ellipse is
       the midpoint of `rect'. If `rect' is square, then the ellipse will be
       circular with radius equal to one-half the width (equivalently, one-half
       the height) of `rect'. If `rect' is rectangular, then the major- and
       minor-axes will be the `width' and `height' of rect. The ellipse forms a
       complete subpath of the path --- that is, it begins with a "move to" and
       ends with a "close subpath" --- oriented in the clockwise direction. If
       `transform' is non-NULL, then the constructed Bézier curves representing
       the ellipse will be transformed by `transform' before they are added to
       the path. */
    
    @available(iOS 5.0, *)
    public /*not inherited*/ init(ellipseIn rect: CGRect, transform: UnsafePointer<CGAffineTransform>?)

    
    /* Return a path representing a rounded rectangle. The rounded rectangle
       coincides with the edges of `rect'. Each corner is consists of
       one-quarter of an ellipse with axes equal to `cornerWidth' and
       `cornerHeight'. The rounded rectangle forms a complete subpath of the
       path --- that is, it begins with a "move to" and ends with a "close
       subpath" --- oriented in the clockwise direction. If `transform' is
       non-NULL, then the path elements representing the rounded rectangle will
       be transformed by `transform' before they are added to the path. */
    
    @available(iOS 7.0, *)
    public /*not inherited*/ init(roundedRect rect: CGRect, cornerWidth: CGFloat, cornerHeight: CGFloat, transform: UnsafePointer<CGAffineTransform>?)

    
    /* Add a rounded rectangle to `path'. The rounded rectangle coincides with
       the edges of `rect'. Each corner is consists of one-quarter of an ellipse
       with axes equal to `cornerWidth' and `cornerHeight'. The rounded
       rectangle forms a complete subpath of the path --- that is, it begins
       with a "move to" and ends with a "close subpath" --- oriented in the
       clockwise direction. If `transform' is non-NULL, then the path elements
       representing the rounded rectangle will be transformed by `transform'
       before they are added to the path. */
    
    /* Create a dashed path from `path'. The parameters `phase', `lengths', and
       `count' have the same meaning as the corresponding parameters for
       `CGContextSetLineDash'. If `transform' is non-NULL, then the elements of
       the constructed path will be transformed by `transform' before they are
       added to the path. */
    
    /* Create a stroked path from `path'. The parameters `lineWidth', `lineCap',
       `lineJoin', and `miterLimit' have the same meaning as the corresponding
       CGContext parameters. If `transform' is non-NULL, then the elements of
       the constructed path will be transformed by `transform' before they are
       added to the path. */
    
    /* Equivalent to `CFRetain(path)', except it doesn't crash (as CFRetain
       does) if `path' is NULL. */
    
    /* Equivalent to `CFRelease(path)', except it doesn't crash (as CFRelease
       does) if `path' is NULL. */
    
    /* Return true if `path1' is equal to `path2'; false otherwise. */
    
    /*** Path construction functions. ***/
    
    /* Move the current point to `(x, y)' in `path' and begin a new subpath. If
       `m' is non-NULL, then transform `(x, y)' by `m' first. */
    
    /* Append a straight line segment from the current point to `(x, y)' in
       `path' and move the current point to `(x, y)'. If `m' is non-NULL, then
       transform `(x, y)' by `m' first. */
    
    /* Append a quadratic curve from the current point to `(x, y)' with control
       point `(cpx, cpy)' in `path' and move the current point to `(x, y)'. If
       `m' is non-NULL, then transform all points by `m' first. */
    
    /* Append a cubic Bézier curve from the current point to `(x,y)' with
       control points `(cp1x, cp1y)' and `(cp2x, cp2y)' in `path' and move the
       current point to `(x, y)'. If `m' is non-NULL, then transform all points
       by `m' first. */
    
    /* Append a line from the current point to the starting point of the current
       subpath of `path' and end the subpath. */
    
    /*** Path construction convenience functions. ***/
    
    /* Add `rect' to `path'. If `m' is non-NULL, then first transform `rect' by
       `m' before adding it to `path'. */
    
    /* Add each rectangle specified by `rects', an array of `count' CGRects, to
       `path'. If `m' is non-NULL, then first transform each rectangle by `m'
       before adding it to `path'. */
    
    /* Move to the first element of `points', an array of `count' CGPoints, and
       append a line from each point to the next point in `points'. If `m' is
       non-NULL, then first transform each point by `m'. */
    
    /* Add an ellipse (an oval) inside `rect' to `path'. The ellipse is
       approximated by a sequence of Bézier curves. The center of the ellipse is
       the midpoint of `rect'. If `rect' is square, then the ellipse will be
       circular with radius equal to one-half the width (equivalently, one-half
       the height) of `rect'. If `rect' is rectangular, then the major- and
       minor-axes will be the `width' and `height' of rect. The ellipse forms a
       complete subpath of `path' --- that is, it begins with a "move to" and
       ends with a "close subpath" --- oriented in the clockwise direction. If
       `m' is non-NULL, then the constructed Bézier curves representing the
       ellipse will be transformed by `m' before they are added to `path'. */
    
    /* Add an arc of a circle to `path', possibly preceded by a straight line
       segment. The arc is approximated by a sequence of Bézier curves. The
       center of the arc is `(x,y)'; `radius' is its radius. `startAngle' is the
       angle to the first endpoint of the arc, measured counter-clockwise from
       the positive x-axis. `startAngle + delta' is the angle to the second
       endpoint of the arc. If `delta' is positive, then the arc is drawn
       counter-clockwise; if negative, clockwise. `startAngle' and `delta' are
       measured in radians. If `matrix' is non-NULL, then the constructed Bézier
       curves representing the arc will be transformed by `matrix' before they
       are added to the path. */
    
    /* Add an arc of a circle to `path', possibly preceded by a straight line
       segment. The arc is approximated by a sequence of Bézier curves. `(x, y)'
       is the center of the arc; `radius' is its radius; `startAngle' is the
       angle to the first endpoint of the arc; `endAngle' is the angle to the
       second endpoint of the arc; and `clockwise' is true if the arc is to be
       drawn clockwise, false otherwise. `startAngle' and `endAngle' are
       measured in radians. If `m' is non-NULL, then the constructed Bézier
       curves representing the arc will be transformed by `m' before they are
       added to `path'.
    
       Note that using values very near 2π can be problematic. For example,
       setting `startAngle' to 0, `endAngle' to 2π, and `clockwise' to true will
       draw nothing. (It's easy to see this by considering, instead of 0 and 2π,
       the values ε and 2π - ε, where ε is very small.) Due to round-off error,
       however, it's possible that passing the value `2 * M_PI' to approximate
       2π will numerically equal to 2π + δ, for some small δ; this will cause a
       full circle to be drawn.
    
       If you want a full circle to be drawn clockwise, you should set
       `startAngle' to 2π, `endAngle' to 0, and `clockwise' to true. This avoids
       the instability problems discussed above. */
    
    /* Add an arc of a circle to `path', possibly preceded by a straight line
       segment. The arc is approximated by a sequence of Bézier curves. `radius'
       is the radius of the arc. The resulting arc is tangent to the line from
       the current point of `path' to `(x1, y1)', and the line from `(x1, y1)'
       to `(x2, y2)'. If `m' is non-NULL, then the constructed Bézier curves
       representing the arc will be transformed by `m' before they are added to
       `path'. */
    
    /* Add `path2' to `path1'. If `m' is non-NULL, then the points in `path2'
       will be transformed by `m' before they are added to `path1'. */
    
    
    /* Return true if `path' contains no elements, false otherwise. */
    
    /*** Path information functions. ***/
    @available(iOS 2.0, *)
    public var isEmpty: Bool { get }

    
    /* Return true if `path' represents a rectangle, false otherwise. */
    
    @available(iOS 2.0, *)
    public func isRect(_ rect: UnsafeMutablePointer<CGRect>?) -> Bool

    
    /* Return the current point of the current subpath of `path'. If there is no
       current point, then return CGPointZero. */
    
    @available(iOS 2.0, *)
    public var currentPoint: CGPoint { get }

    
    /* Return the bounding box of `path'. The bounding box is the smallest
       rectangle completely enclosing all points in the path, including control
       points for Bézier cubic and quadratic curves. If the path is empty, then
       return `CGRectNull'. */
    
    @available(iOS 2.0, *)
    public var boundingBox: CGRect { get }

    
    /* Return the path bounding box of `path'. The path bounding box is the
       smallest rectangle completely enclosing all points in the path, *not*
       including control points for Bézier cubic and quadratic curves. If the
       path is empty, then return `CGRectNull'. */
    
    @available(iOS 4.0, *)
    public var boundingBoxOfPath: CGRect { get }

    
    /* Return true if `point' is contained in `path'; false otherwise. A point
       is contained in a path if it is inside the painted region when the path
       is filled; if `eoFill' is true, then the even-odd fill rule is used to
       evaluate the painted region of the path, otherwise, the winding-number
       fill rule is used. If `m' is non-NULL, then the point is transformed by
       `m' before determining whether the path contains it. */
    
    /* The types of path elements returned by `CGPathApply'. */
    
    /* An element of a path returned by `CGPathApply'. */
    
    /* The prototype for the function called by `CGPathApplyFunction'. */
    
    /* For element of `path', call `function', passing it the path element and
       `info'. */
    
    @available(iOS 2.0, *)
    public func apply(info: UnsafeMutableRawPointer?, function: CGPathApplierFunction)

    
    @available(iOS 11.0, *)
    public func applyWithBlock(_ block: (UnsafePointer<CGPathElement>) -> Void)
}
extension CGMutablePath {

    @available(iOS 2.0, *)
    public /*not inherited*/ init()

    @available(iOS 7.0, *)
    public func __addRoundedRect(transform: UnsafePointer<CGAffineTransform>?, rect: CGRect, cornerWidth: CGFloat, cornerHeight: CGFloat)

    @available(iOS 2.0, *)
    public func closeSubpath()
}
public enum CGPathElementType : Int32 {

    case moveToPoint = 0

    case addLineToPoint = 1

    case addQuadCurveToPoint = 2

    case addCurveToPoint = 3

    case closeSubpath = 4
}
public struct CGPathElement {

    public var type: CGPathElementType

    public var points: UnsafeMutablePointer<CGPoint>

    public init(type: CGPathElementType, points: UnsafeMutablePointer<CGPoint>)
}
public typealias CGPathApplierFunction = @convention(c) (UnsafeMutableRawPointer?, UnsafePointer<CGPathElement>) -> Void

public typealias CGPathApplyBlock = (UnsafePointer<CGPathElement>) -> Void
